package com.zhangshuo.patternDesign.facade;

/**
 * Created by shuo.zhang on 2017-10-23.
 */
public class Facade implements IFacade {

    private ISub1 sub1 ;

    private ISub2 sub2 ;

    private ISub3 sub3 ;

    public Facade(ISub1 sub1, ISub2 sub2, ISub3 sub3) {
        this.sub1 = sub1;
        this.sub2 = sub2;
        this.sub3 = sub3;
    }

    @Override
    public void facadeMethod1() {
        System.out.println("门面的第一个方法,实际上是第一个sub1与sub3的方法混合");
        sub1.method1();
        sub3.method3();
    }

    @Override
    public void facadeMethod2() {
        System.out.println("门面的第一个方法,实际上是第一个sub2与sub3的方法混合");
        sub2.method2();
        sub3.method3();
    }
}
